package omg.ligong.server;

import omg.ligong.dao.DAOFactory;
import omg.ligong.db.ConnectionManager;

/**
 * 服务器管理类
 * 
 * @author weishuang
 * 
 * 2011-4-23 上午12:09:56
 */
public class CourseManagerServer {
	private static CourseManagerServer _ins = null;

	private CourseManagerServer() {
	}

	public static CourseManagerServer getInstance() {
		if (_ins == null) {
			synchronized (CourseManagerServer.class) {
				if (_ins == null) {
					_ins = new CourseManagerServer();
				}
			}
		}
		return _ins;
	}

	public String getWorkDir() {
		return WorkDir.getInstance().getDir();
	}

	public WorkDir getWorkDirObj() {
		return WorkDir.getInstance();
	}

	public String getTempDir() {
		return WorkDir.getInstance().getTempDir();
	}

	public static void releaseInstance() {
		_ins = null;
		AdminMgr.releaseInstance();
		WorkDir.releaseInstance();
		ConnectionManager.getInstance().releaseInstance();
		DAOFactory.getInstance().releaseInstance();
	}
}
